knitr::opts_chunk$set(echo = TRUE)

rm(list = ls())

#cmdstanr::set_cmdstan_path(path = "C:/Users/kueng/.cmdstan/cmdstan-2.35.0")
#cmdstanr::set_cmdstan_path(path = "C:/Users/pascku/.cmdstan/cmdstan-2.36.0")

library(tidyverse)
library(R.utils)
library(wbCorr)
library(readxl)
library(kableExtra)
library(brms)
library(bayesplot)
library(see)
library(beepr)
library(DHARMa)
library(digest)



source(file.path('Functions', 'ReportModels.R'))
source(file.path('Functions', 'PrettyTables.R'))
source(file.path('Functions', 'ReportMeasures.R'))
source(file.path('Functions', 'PrepareData.R'))

report_function_hash <- digest::digest(summarize_brms)
system("shutdown /a")
## [1] 1116
# Set options for analysis
use_mi = FALSE
shutdown = FALSE
report_ordinal = FALSE
do_priorsense = FALSE
get_bayesfactor = TRUE
check_models = TRUE #

if (get_bayesfactor) {
  stats_to_report <- c('CI', 'SE', 'pd', 'ROPE', 'BF', 'Rhat', 'ESS')
} else {
  stats_to_report <- c('CI', 'SE', 'pd', 'ROPE', 'Rhat', 'ESS')
}

options(
  dplyr.print_max = 100, 
  brms.backend = 'cmdstan',
  brms.file_refit = ifelse(use_mi, 'never', 'on_change'),
  brms.file_refit = 'on_change',
  #brms.file_refit = 'always',
  error = function() {
    beepr::beep(sound = 5)
    if (shutdown) {
      system("shutdown /s /t 180")
      quit(save = "no", status = 1)
    }
  }
  , es.use_symbols = TRUE
)


####################### Model parameters #######################

iterations = 12000 # 12'000 per chain to achieve 40'000
warmup = 2000 # 2000

# NO AR!!!
#corstr = 'ar'
#corstr = 'cosy_couple'
#corstr = 'cosy_couple:user'


################################################################

suffix = paste0('_sensitivityOtherCovariates_', as.character(iterations))
df <- openxlsx::read.xlsx(file.path('long.xlsx'))
df_original <- df

df_double <- prepare_data(df, recode_pushing = TRUE, use_mi = use_mi)[[1]]

Constructing scales Re-coding pusing reshaping data (4field) centering data within and between

summary(df_double$pushing)

Min. 1st Qu. Median Mean 3rd Qu. Max. NA’s 0.0000 0.0000 0.0000 0.1649 0.0000 5.0000 275

Modelling

# For indistinguishable Dyads
model_rows_fixed <- c(
    'Intercept', 
    # '-- WITHIN PERSON MAIN EFFECTS --', 
    'persuasion_self_cw', 
    'persuasion_partner_cw', 
    'pressure_self_cw', 
    'pressure_partner_cw', 
    'pushing_self_cw', 
    'pushing_partner_cw', 
    'day', 
    'plan_selfPlan',
    'plan_partnerPlan',
    'weartime_self_cw',
    
    'support_self_cw',
    'support_partner_cw',
    'isWeekendWeekend',
    'got_JITAI_selfJITAIreceived',
    'skilled_supportDaysafterIntervention',
    
    
    # '-- BETWEEN PERSON MAIN EFFECTS',
    'persuasion_self_cb',
    'persuasion_partner_cb',
    'pressure_self_cb',
    'pressure_partner_cb',
    'pushing_self_cb',
    'pushing_partner_cb',
    'weartime_self_cb',
    
    'support_self_cb',
    'support_partner_cb',
    'studyGroupFirst3weeksinterventions',
    'studyGrouplast3weeksinterventions'
  )


model_rows_fixed_ordinal <- c(
  model_rows_fixed[1],
  'Intercept[1]',
  'Intercept[2]',
  'Intercept[3]',
  'Intercept[4]',
  'Intercept[5]',
  model_rows_fixed[2:length(model_rows_fixed)]
)

model_rows_random <- c(
  # '--------------',
  # '-- RANDOM EFFECTS --',
  'sd(Intercept)', 
  'sd(persuasion_self_cw)',
  'sd(persuasion_partner_cw)',
  'sd(pressure_self_cw)',
  'sd(pressure_partner_cw)',
  'sd(pushing_self_cw)',
  'sd(pushing_partner_cw)',
  # '-- CORRELATION STRUCTURE -- ', 
  'sigma'
)

model_rows_random_ordinal <- c(model_rows_random,'disc')
# For indistinguishable Dyads
model_rownames_fixed <- c(
    "Intercept", 
    # "-- WITHIN PERSON MAIN EFFECTS --", 
    "Daily individual's experienced persuasion",  
    "Daily partner's experienced persuasion", 
    "Daily individual's experienced pressure", 
    "Daily partner's experienced pressure", 
    "Daily individual's experienced pushing", 
    "Daily partner's experienced pushing", 
    "Day", 
    "Own Actionplan",
    'Partner Actionplan',
    "Daily weartime",
    
    'Daily support received',
    "Daily support provided (partner's view)",
    'Is a Weekend',
    'JITAI received',
    'Days post skilled support intervention',
    
    # "-- BETWEEN PERSON MAIN EFFECTS",
    "Mean individual's experienced persuasion", 
    "Mean partner's experienced persuasion", 
    "Mean individual's experienced pressure", 
    "Mean partner's experienced pressure", 
    "Mean individual's experienced pushing", 
    "Mean partner's experienced pushing", 
    "Mean weartime",
    
    "Mean individual's received support",
    "Mean partner's received support",
    'Difference study group 2',
    'Difference study group 3'
  )


model_rownames_fixed_ordinal <- c(
  model_rownames_fixed[1],
  'Intercept[1]',
  'Intercept[2]',
  'Intercept[3]',
  'Intercept[4]',
  'Intercept[5]',
  model_rownames_fixed[2:length(model_rownames_fixed)]
)

model_rownames_random <- c(
  # '--------------',
  # '-- RANDOM EFFECTS --',
  'sd(Intercept)', 
  "sd(Daily individual's experienced persuasion)", 
  "sd(Daily partner's experienced persuasion)", # OR partner received
  "sd(Daily individual's experienced pressure)", 
  "sd(Daily partner's experienced pressure)", 
  "sd(Daily individual's experienced pushing)", 
  "sd(Daily partner's experienced pushing)", 
  # '-- CORRELATION STRUCTURE -- ', 
  'sigma'
)


model_rownames_random_ordinal <- c(model_rownames_random,'disc')
rows_to_pack <- list(
  "Within-Person Effects" = c(2,16),
  "Between-Person Effects" = c(17,27),
  "Random Effects" = c(28, 34), 
  "Additional Parameters" = c(35,35)
  )


rows_to_pack_ordinal <- list(
  "Intercepts" = c(1,6),
  "Within-Person Effects" = c(2+5,16+5),
  "Between-Person Effects" = c(17+5,27+5),
  "Random Effects" = c(28+5, 34+5), 
  "Additional Parameters" = c(35+5,35+6)
  )

Self-Reported MVPA

Hurdle Lognormal Model

formula <- bf(
  pa_sub ~ 
    persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    
    #support_self_cw + support_partner_cw + 
    isWeekend + 
    got_JITAI_self + 
    skilled_support +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    #support_self_cb + support_partner_cb + 
    studyGroup +
    
    plan_self + plan_partner +
    day + 
    
    # Random effects
    (1 + persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | dd | coupleID),
  
  hu = ~ persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    
    #support_self_cw + support_partner_cw + 
    isWeekend + 
    got_JITAI_self + 
    skilled_support +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    #support_self_cb + support_partner_cb + 
    studyGroup +
    
    plan_self + plan_partner +
    day + 
    
    # Random effects
    (1 + persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | dd | coupleID)
  
  , decomp = 'QR'
  #, autocor = autocor_str
) 

prior1 <- c(
  brms::set_prior("normal(0, 2.5)", class = "b")
  , brms::set_prior("normal(0, 2)", class = "b", dpar = "hu")
  , brms::set_prior("normal(0, 50)", class = "Intercept") # for non-zero PA
  , brms::set_prior("normal(0.5, 2.5)", class = "Intercept", dpar = 'hu') # hurdle part
  , brms::set_prior("normal(0, 2)", class = "sd", group = "coupleID", lb = 0)
  , brms::set_prior("student_t(3, 0, 2.5)", class = "sigma", lb = 0)
)

#brms::validate_prior(
#  prior1, 
#  formula = formula, 
#  data = df_double, 
#  family = hurdle_lognormal()
#)

#df_minimal <- df_double[, c("AorB", all.vars(as.formula(formula)))]

pa_sub <- my_brm(
  mi = use_mi, 
  imputed_data = implist,
  
  formula = formula, 
  prior = prior1,
  data = df_double, 
  family = brms::hurdle_lognormal(), 
  #family = brms::hurdle_negbinomial(), 
  #family = brms::hurdle_poisson(),
  #control = list(adapt_delta = 0.95, max_treedepth = 15),
  iter = iterations,
  warmup = warmup,
  chains = 4,
  cores = 4,
  seed = 42,
  file = file.path("models_cache_brms", paste0("pa_sub_hu_lognormal", suffix))
  #, file_refit = 'always'
)
## Warning: Rows containing NAs were excluded from the model.
pa_sub_digest <- digest::digest(pa_sub)
# rope range for continuous part of the model
rope_factor <- sd(log(pa_sub$data$pa_sub[pa_sub$data$pa_sub > 0]))
rope_range_continuous = c(-0.1 * rope_factor, 0.1 * rope_factor)

summary_pa_sub <- summarize_brms(
  pa_sub, 
  stats_to_report = stats_to_report,
  rope_range = rope_range_continuous,
  hu_rope_range = c(-0.18, 0.18),
  model_rows_fixed = model_rows_fixed,
  model_rows_random = model_rows_random,
  model_rownames_fixed = model_rownames_fixed,
  model_rownames_random = model_rownames_random,
  exponentiate = T) 
## Sampling priors, please wait...
## Warning in summarize_brms(pa_sub, stats_to_report = stats_to_report, rope_range
## = rope_range_continuous, : Coefficients were exponentiated. Double check if
## this was intended.
# Print the updated dataframe
summary_pa_sub %>%
  print_df(rows_to_pack = rows_to_pack)
exp(Est.)_hu SE_hu 95% CI_hu pd_hu ROPE_hu inside ROPE_hu BF_hu BF_Evidence_hu Rhat_hu Bulk_ESS_hu Tail_ESS_hu exp(Est.)_nonzero SE_nonzero 95% CI_nonzero pd_nonzero ROPE_nonzero inside ROPE_nonzero BF_nonzero BF_Evidence_nonzero Rhat_nonzero Bulk_ESS_nonzero Tail_ESS_nonzero
Intercept 0.18*** 0.05 [ 0.10, 0.30] 1.000 [0.84, 1.20] 0.000 >100 Overwhelming Evidence 1.000 35733 31253 29.02*** 3.33 [23.19, 36.50] 1.000 [0.92, 1.08] 0.000 >100 Overwhelming Evidence 1.000 18775 26518
Within-Person Effects
Daily individual’s experienced persuasion 1.57*** 0.11 [ 1.38, 1.83] 1.000 [0.84, 1.20] 0.000 >100 Overwhelming Evidence 1.000 51560 33810 1.03 0.03 [ 0.98, 1.08] 0.855 [0.92, 1.08] 0.967 0.016 Very Strong Evidence for Null 1.000 34176 33120
Daily partner’s experienced persuasion 1.33*** 0.09 [ 1.18, 1.53] 1.000 [0.84, 1.20] 0.046 >100 Overwhelming Evidence 1.000 51987 30034 1.03 0.02 [ 0.98, 1.07] 0.871 [0.92, 1.08] 0.986 0.015 Very Strong Evidence for Null 1.000 39777 34751
Daily individual’s experienced pressure 0.98 0.16 [ 0.70, 1.37] 0.540 [0.84, 1.20] 0.724 0.079 Strong Evidence for Null 1.000 53291 32379 0.90* 0.05 [ 0.81, 1.00] 0.978 [0.92, 1.08] 0.293 0.067 Strong Evidence for Null 1.000 41024 37149
Daily partner’s experienced pressure 1.56* 0.34 [ 1.04, 2.74] 0.983 [0.84, 1.20] 0.101 1.060 Weak Evidence 1.000 40719 27620 0.95 0.04 [ 0.86, 1.04] 0.880 [0.92, 1.08] 0.715 0.012 Very Strong Evidence for Null 1.000 42700 38100
Daily individual’s experienced pushing 1.00 0.14 [ 0.76, 1.35] 0.501 [0.84, 1.20] 0.785 0.071 Strong Evidence for Null 1.000 46932 33301 0.99 0.03 [ 0.92, 1.05] 0.662 [0.92, 1.08] 0.972 0.008 Very Strong Evidence for Null 1.000 49562 36055
Daily partner’s experienced pushing 1.33* 0.16 [ 1.05, 1.72] 0.992 [0.84, 1.20] 0.189 1.107 Weak Evidence 1.000 55699 32118 0.96 0.03 [ 0.90, 1.02] 0.903 [0.92, 1.08] 0.898 0.015 Very Strong Evidence for Null 1.000 49205 33720
Day 0.69 0.15 [ 0.46, 1.04] 0.961 [0.84, 1.20] 0.178 0.499 Weak Evidence for Null 1.000 67971 32562 0.94 0.08 [ 0.79, 1.11] 0.763 [0.92, 1.08] 0.525 0.009 Very Strong Evidence for Null 1.000 71902 32082
Own Actionplan 11.49*** 1.23 [ 9.35, 14.19] 1.000 [0.84, 1.20] 0.000 >100 Overwhelming Evidence 1.000 71441 30644 1.37*** 0.07 [ 1.24, 1.50] 1.000 [0.92, 1.08] 0.000 >100 Overwhelming Evidence 1.000 83623 32212
Partner Actionplan 1.24* 0.13 [ 1.01, 1.51] 0.980 [0.84, 1.20] 0.374 0.406 Weak Evidence for Null 1.000 79370 32484 1.08 0.05 [ 0.99, 1.18] 0.965 [0.92, 1.08] 0.496 0.039 Strong Evidence for Null 1.000 79643 31132
Daily weartime NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
Daily support received NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
Daily support provided (partner’s view) NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
Is a Weekend 1.57*** 0.16 [ 1.29, 1.91] 1.000 [0.84, 1.20] 0.003 >100 Overwhelming Evidence 1.000 91266 30219 1.19*** 0.05 [ 1.10, 1.28] 1.000 [0.92, 1.08] 0.007 29.029 Strong Evidence 1.000 86831 28268
JITAI received 0.49*** 0.06 [ 0.38, 0.63] 1.000 [0.84, 1.20] 0.000 >100 Overwhelming Evidence 1.000 82907 32045 0.94 0.05 [ 0.85, 1.04] 0.874 [0.92, 1.08] 0.632 0.013 Very Strong Evidence for Null 1.000 66812 30880
Days post skilled support intervention 1.31 0.21 [ 0.96, 1.80] 0.954 [0.84, 1.20] 0.281 0.328 Weak Evidence for Null 1.000 65743 31177 1.07 0.07 [ 0.94, 1.21] 0.853 [0.92, 1.08] 0.573 0.012 Very Strong Evidence for Null 1.000 55612 36199
Between-Person Effects
Mean individual’s experienced persuasion 1.44 0.57 [ 0.65, 3.13] 0.815 [0.84, 1.20] 0.233 0.298 Moderate Evidence for Null 1.000 28924 30569 0.99 0.15 [ 0.72, 1.34] 0.536 [0.92, 1.08] 0.390 0.015 Very Strong Evidence for Null 1.000 30611 31893
Mean partner’s experienced persuasion 1.32 0.52 [ 0.60, 2.88] 0.760 [0.84, 1.20] 0.275 0.256 Moderate Evidence for Null 1.000 28495 28933 0.93 0.14 [ 0.68, 1.26] 0.685 [0.92, 1.08] 0.352 0.016 Very Strong Evidence for Null 1.000 30014 30924
Mean individual’s experienced pressure 0.16*** 0.09 [ 0.05, 0.47] 1.000 [0.84, 1.20] 0.001 71.361 Very Strong Evidence 1.000 40609 34634 0.69 0.26 [ 0.33, 1.45] 0.840 [0.92, 1.08] 0.100 0.037 Strong Evidence for Null 1.000 12525 19285
Mean partner’s experienced pressure 0.27* 0.15 [ 0.08, 0.78] 0.992 [0.84, 1.20] 0.016 5.038 Moderate Evidence 1.000 40177 33679 0.53 0.20 [ 0.25, 1.12] 0.953 [0.92, 1.08] 0.039 0.094 Strong Evidence for Null 1.000 12126 18855
Mean individual’s experienced pushing 1.39 0.85 [ 0.42, 4.73] 0.708 [0.84, 1.20] 0.204 0.351 Weak Evidence for Null 1.000 36971 33082 1.47 0.40 [ 0.86, 2.52] 0.922 [0.92, 1.08] 0.082 0.041 Strong Evidence for Null 1.000 17225 24575
Mean partner’s experienced pushing 2.33 1.41 [ 0.70, 7.85] 0.918 [0.84, 1.20] 0.090 0.800 Weak Evidence for Null 1.000 36654 32185 1.63 0.44 [ 0.94, 2.83] 0.960 [0.92, 1.08] 0.048 0.074 Strong Evidence for Null 1.000 18057 23622
Mean weartime NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
Mean individual’s received support NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
Mean partner’s received support NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
Difference study group 2 0.79 0.28 [ 0.39, 1.60] 0.752 [0.84, 1.20] 0.316 0.226 Moderate Evidence for Null 1.000 33038 30920 1.06 0.14 [ 0.81, 1.38] 0.672 [0.92, 1.08] 0.412 0.023 Very Strong Evidence for Null 1.000 19899 26220
Difference study group 3 1.17 0.39 [ 0.59, 2.33] 0.675 [0.84, 1.20] 0.369 0.187 Moderate Evidence for Null 1.000 35675 29635 1.25 0.16 [ 0.97, 1.60] 0.962 [0.92, 1.08] 0.110 0.090 Strong Evidence for Null 1.000 21415 25449
Random Effects
sd(Intercept) 0.83 0.12 [0.63, 1.12] NA NA NA NA NA 1.000 26004 29358 0.29 0.04 [0.22, 0.40] NA NA NA NA NA 1.000 18362 26998
sd(Daily individual’s experienced persuasion) 0.20 0.09 [0.03, 0.40] NA NA NA NA NA 1.000 17340 18974 0.12 0.02 [0.08, 0.17] NA NA NA NA NA 1.000 27247 31529
sd(Daily partner’s experienced persuasion) 0.16 0.10 [0.01, 0.36] NA NA NA NA NA 1.000 14203 20274 0.08 0.02 [0.04, 0.13] NA NA NA NA NA 1.000 27278 27450
sd(Daily individual’s experienced pressure) 0.21 0.19 [0.01, 0.78] NA NA NA NA NA 1.000 25017 26936 0.07 0.06 [0.00, 0.23] NA NA NA NA NA 1.000 22361 24734
sd(Daily partner’s experienced pressure) 0.39 0.32 [0.02, 1.25] NA NA NA NA NA 1.000 18619 25027 0.05 0.05 [0.00, 0.18] NA NA NA NA NA 1.000 27800 25034
sd(Daily individual’s experienced pushing) 0.51 0.17 [0.21, 0.91] NA NA NA NA NA 1.000 24757 22151 0.08 0.04 [0.01, 0.16] NA NA NA NA NA 1.000 16136 17692
sd(Daily partner’s experienced pushing) 0.23 0.16 [0.01, 0.59] NA NA NA NA NA 1.000 18975 22686 0.07 0.04 [0.01, 0.14] NA NA NA NA NA 1.000 17731 17041
Additional Parameters
sigma NA NA NA NA NA NA NA NA NA NA NA 0.67 0.01 [0.65, 0.70] NA NA NA NA NA 1.000 67759 30466
# Plot continuous part of model

variable <- c(
  '(Intercept)',
  'b_persuasion_self_cw',
  'b_persuasion_partner_cw',
  'b_pressure_self_cw',
  'b_pressure_partner_cw',
  'b_pushing_self_cw',
  'b_pushing_partner_cw'
)


plot(
  bayestestR::p_direction(pa_sub, parameter = variable),
  priors = TRUE
) + theme_bw()

plot(
  bayestestR::rope(
    pa_sub, 
    parameter = variable, 
    range = rope_range_continuous,
    verbose = F,
    ci = 1
  )
) + theme_bw()

# Hurdle part of the model
variable <- c(
  'b_hu_persuasion_self_cw',
  'b_hu_persuasion_partner_cw',
  'b_hu_pressure_self_cw',
  'b_hu_pressure_partner_cw',
  'b_hu_pushing_self_cw',
  'b_hu_pushing_partner_cw'
)

plot(
  bayestestR::p_direction(pa_sub, parameter = variable),
  priors = TRUE
) + theme_bw()

# The rope range for the bernoulli part of the model is -0.18, 0.18
plot(
  bayestestR::rope(pa_sub, parameter = variable, range = c(-0.18, 0.18), ci = 1),
  verbose = FALSE
) + theme_bw()
## Possible multicollinearity between b_hu_persuasion_partner_cb and
##   b_hu_persuasion_self_cb (r = 0.78), b_persuasion_partner_cb and
##   b_persuasion_self_cb (r = 0.76), b_pressure_partner_cb and
##   b_pressure_self_cb (r = 0.82). This might lead to inappropriate results.
##   See 'Details' in '?rope'.

Device Based MVPA

Lognormal Model

formula <- bf(
  pa_obj ~ 
    persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    
    #support_self_cw + support_partner_cw + 
    isWeekend + 
    got_JITAI_self + 
    skilled_support +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    #support_self_cb + support_partner_cb + 
    studyGroup +
    
    plan_self + plan_partner +
    day +  + weartime_self_cw + weartime_self_cb +
    
    # Random effects
    (persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | coupleID)
  
  , decomp = 'QR'
  #, autocor = autocor_str
)



prior1 <- c(
  brms::set_prior("normal(0, 2.5)", class = "b")
  , brms::set_prior("normal(0, 50)", class = "Intercept") 
  , brms::set_prior("normal(0, 2)", class = "sd", group = "coupleID", lb = 0)
  , brms::set_prior("student_t(3, 0, 2.5)", class = "sigma", lb = 0)
)


#brms::validate_prior(
#  prior1, 
#  formula = formula, 
#  data = df_double, 
#  family = lognormal()
#  )

#df_minimal <- df_double[, c("AorB", all.vars(as.formula(formula)))]

pa_obj_log <- my_brm(
  mi = use_mi, 
  imputed_data = implist,
  
  formula = formula, 
  prior = prior1,
  data = df_double, 
  family = lognormal(),
  #control = list(adapt_delta = 0.95),
  iter = iterations,
  warmup = warmup,
  chains = 4,
  cores = 4,
  seed = 7777,
  file = file.path("models_cache_brms", paste0("pa_obj_log_gaussian", suffix))
)
## Warning: Rows containing NAs were excluded from the model.
pa_obj_log_digest <- digest::digest(pa_obj_log)
# rope range for lognormal model
rope_factor <- sd(log(pa_obj_log$data$pa_obj))
rope_range_log = c(-0.1 * rope_factor, 0.1 * rope_factor)

summary_pa_obj <- summarize_brms(
  pa_obj_log, 
  stats_to_report = stats_to_report,
  rope_range = rope_range_log,
  model_rows_fixed = model_rows_fixed,
  model_rows_random = model_rows_random,
  model_rownames_fixed = model_rownames_fixed,
  model_rownames_random = model_rownames_random,
  exponentiate = T) 
## Warning in compute_rope(range = rope_range): Collinearity detected. Some VIFs
## are > 10. This may invalidate ROPE inferences!

Check for Multicollinearity

Low Correlation

              Term  VIF     VIF 95% CI Increased SE Tolerance
persuasion_self_cw 1.11 [ 1.08,  1.15]         1.05      0.90

persuasion_partner_cw 1.14 [ 1.10, 1.18] 1.07 0.88 pressure_self_cw 1.07 [ 1.04, 1.12] 1.04 0.93 pressure_partner_cw 1.11 [ 1.08, 1.16] 1.06 0.90 pushing_self_cw 1.13 [ 1.09, 1.17] 1.06 0.89 pushing_partner_cw 1.18 [ 1.14, 1.23] 1.09 0.85 isWeekend 1.05 [ 1.02, 1.10] 1.02 0.96 got_JITAI_self 1.09 [ 1.06, 1.13] 1.04 0.92 skilled_support 2.01 [ 1.92, 2.10] 1.42 0.50 pressure_self_cb 4.28 [ 4.05, 4.52] 2.07 0.23 pressure_partner_cb 4.69 [ 4.44, 4.96] 2.17 0.21 studyGroup 1.17 [ 1.13, 1.21] 1.08 0.86 plan_self 1.30 [ 1.25, 1.35] 1.14 0.77 plan_partner 1.30 [ 1.25, 1.35] 1.14 0.77 day 1.94 [ 1.85, 2.03] 1.39 0.52 weartime_self_cw 1.05 [ 1.03, 1.10] 1.03 0.95 weartime_self_cb 1.25 [ 1.21, 1.30] 1.12 0.80 Tolerance 95% CI [0.87, 0.93] [0.85, 0.91] [0.90, 0.96] [0.86, 0.93] [0.85, 0.92] [0.82, 0.88] [0.91, 0.98] [0.88, 0.95] [0.48, 0.52] [0.22, 0.25] [0.20, 0.23] [0.82, 0.88] [0.74, 0.80] [0.74, 0.80] [0.49, 0.54] [0.91, 0.97] [0.77, 0.83]

Moderate Correlation

           Term  VIF     VIF 95% CI Increased SE Tolerance Tolerance 95% CI

persuasion_self_cb 9.97 [ 9.40, 10.57] 3.16 0.10 [0.09, 0.11] pushing_self_cb 6.75 [ 6.38, 7.15] 2.60 0.15 [0.14, 0.16] pushing_partner_cb 6.58 [ 6.22, 6.97] 2.57 0.15 [0.14, 0.16]

High Correlation

              Term   VIF     VIF 95% CI Increased SE Tolerance

persuasion_partner_cb 10.84 [10.22, 11.49] 3.29 0.09 Tolerance 95% CI [0.09, 0.10]

## Sampling priors, please wait...
## Warning in summarize_brms(pa_obj_log, stats_to_report = stats_to_report, :
## Coefficients were exponentiated. Double check if this was intended.
summary_pa_obj %>%
  print_df(rows_to_pack = rows_to_pack)
exp(Est.) SE 95% CI pd ROPE inside ROPE BF BF_Evidence Rhat Bulk_ESS Tail_ESS
Intercept 108.21*** 9.80 [90.06, 129.44] 1.000 [0.94, 1.07] 0.000 >100 Overwhelming Evidence 1.000 8093 13915
Within-Person Effects
Daily individual’s experienced persuasion 1.03 0.02 [ 1.00, 1.06] 0.951 [0.94, 1.07] 0.996 0.021 Very Strong Evidence for Null 1.000 33778 30856
Daily partner’s experienced persuasion 1.01 0.02 [ 0.98, 1.05] 0.794 [0.94, 1.07] 0.999 0.008 Very Strong Evidence for Null 1.000 34387 29786
Daily individual’s experienced pressure 0.95 0.03 [ 0.88, 1.01] 0.945 [0.94, 1.07] 0.611 0.018 Very Strong Evidence for Null 1.000 52258 32119
Daily partner’s experienced pressure 0.98 0.03 [ 0.92, 1.05] 0.705 [0.94, 1.07] 0.909 0.005 Very Strong Evidence for Null 1.000 57383 31698
Daily individual’s experienced pushing 1.02 0.03 [ 0.96, 1.07] 0.728 [0.94, 1.07] 0.971 0.007 Very Strong Evidence for Null 1.000 35362 29553
Daily partner’s experienced pushing 1.00 0.02 [ 0.96, 1.04] 0.512 [0.94, 1.07] 0.997 0.004 Very Strong Evidence for Null 1.000 56192 30841
Day 0.94 0.05 [ 0.86, 1.03] 0.897 [0.94, 1.07] 0.523 0.009 Very Strong Evidence for Null 1.000 79678 29938
Own Actionplan 1.08** 0.03 [ 1.02, 1.13] 0.998 [0.94, 1.07] 0.369 0.301 Weak Evidence for Null 1.000 81270 27656
Partner Actionplan 1.05* 0.03 [ 1.00, 1.11] 0.983 [0.94, 1.07] 0.681 0.039 Strong Evidence for Null 1.000 75784 29403
Daily weartime 1.00*** 0.00 [ 1.00, 1.00] 1.000 [0.94, 1.07] 1.000 34.126 Very Strong Evidence 1.000 84568 28829
Daily support received NA NA NA NA NA NA NA NA NA NA NA
Daily support provided (partner’s view) NA NA NA NA NA NA NA NA NA NA NA
Is a Weekend 1.06** 0.02 [ 1.01, 1.11] 0.995 [0.94, 1.07] 0.579 0.117 Moderate Evidence for Null 1.000 72368 28911
JITAI received 0.93* 0.03 [ 0.87, 0.99] 0.993 [0.94, 1.07] 0.380 0.078 Strong Evidence for Null 1.000 76607 31051
Days post skilled support intervention 1.05 0.04 [ 0.98, 1.13] 0.915 [0.94, 1.07] 0.653 0.010 Very Strong Evidence for Null 1.000 55394 35489
Between-Person Effects
Mean individual’s experienced persuasion 1.10 0.16 [ 0.82, 1.49] 0.740 [0.94, 1.07] 0.279 0.016 Very Strong Evidence for Null 1.000 8034 14915
Mean partner’s experienced persuasion 0.98 0.15 [ 0.73, 1.33] 0.546 [0.94, 1.07] 0.336 0.014 Very Strong Evidence for Null 1.000 8049 14874
Mean individual’s experienced pressure 0.98 0.15 [ 0.72, 1.32] 0.565 [0.94, 1.07] 0.324 0.008 Very Strong Evidence for Null 1.000 10867 19807
Mean partner’s experienced pressure 0.98 0.14 [ 0.73, 1.32] 0.549 [0.94, 1.07] 0.337 0.009 Very Strong Evidence for Null 1.000 9460 17590
Mean individual’s experienced pushing 0.96 0.20 [ 0.63, 1.47] 0.577 [0.94, 1.07] 0.236 0.011 Very Strong Evidence for Null 1.000 10569 17814
Mean partner’s experienced pushing 1.20 0.25 [ 0.79, 1.84] 0.812 [0.94, 1.07] 0.163 0.017 Very Strong Evidence for Null 1.000 10506 17487
Mean weartime 1.00 0.00 [ 1.00, 1.00] 0.934 [0.94, 1.07] 1.000 0.021 Very Strong Evidence for Null 1.000 43730 31904
Mean individual’s received support NA NA NA NA NA NA NA NA NA NA NA
Mean partner’s received support NA NA NA NA NA NA NA NA NA NA NA
Difference study group 2 0.94 0.11 [ 0.73, 1.20] 0.704 [0.94, 1.07] 0.349 0.023 Very Strong Evidence for Null 1.000 7388 13983
Difference study group 3 1.03 0.13 [ 0.80, 1.33] 0.604 [0.94, 1.07] 0.388 0.017 Very Strong Evidence for Null 1.001 7540 13272
Random Effects
sd(Intercept) 0.30 0.04 [0.24, 0.40] NA NA NA NA NA 1.000 10270 18425
sd(Daily individual’s experienced persuasion) 0.05 0.01 [0.02, 0.08] NA NA NA NA NA 1.000 18370 15467
sd(Daily partner’s experienced persuasion) 0.05 0.02 [0.02, 0.09] NA NA NA NA NA 1.000 16543 11878
sd(Daily individual’s experienced pressure) 0.04 0.03 [0.00, 0.13] NA NA NA NA NA 1.000 21491 21233
sd(Daily partner’s experienced pressure) 0.03 0.03 [0.00, 0.11] NA NA NA NA NA 1.000 24541 19139
sd(Daily individual’s experienced pushing) 0.08 0.04 [0.01, 0.16] NA NA NA NA NA 1.000 10016 12350
sd(Daily partner’s experienced pushing) 0.03 0.02 [0.00, 0.09] NA NA NA NA NA 1.000 16746 18525
Additional Parameters
sigma 0.57 0.01 [0.56, 0.59] NA NA NA NA NA 1.000 64506 27834
plot(
  bayestestR::p_direction(pa_obj_log),
  priors = TRUE
) + 
  coord_cartesian(xlim = c(-3, 3)) +
  theme_bw()
## Warning in `==.default`(dens$Parameter, parameter): longer object length is not
## a multiple of shorter object length
## Warning in is.na(e1) | is.na(e2): longer object length is not a multiple of
## shorter object length

plot(
  bayestestR::rope(pa_obj_log, range = rope_range_log, ci = 1)
) + theme_bw()
## Possible multicollinearity between b_persuasion_partner_cb and
##   b_persuasion_self_cb (r = 0.9), b_pressure_self_cb and
##   b_persuasion_self_cb (r = 0.73), b_pressure_partner_cb and
##   b_persuasion_self_cb (r = 0.74), b_pressure_self_cb and
##   b_persuasion_partner_cb (r = 0.71), b_pressure_partner_cb and
##   b_persuasion_partner_cb (r = 0.77), b_pushing_partner_cb and
##   b_pushing_self_cb (r = 0.84). This might lead to inappropriate results.
##   See 'Details' in '?rope'.

# Nothing significant, no plots

Affect

Gaussian

formula <- bf(
  aff ~ 
    persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    
    #support_self_cw + support_partner_cw + 
    isWeekend + 
    got_JITAI_self + 
    skilled_support +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    #support_self_cb + support_partner_cb + 
    studyGroup +
    
    plan_self + plan_partner +
    day + 
    
    # Random effects
    (persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | coupleID)
  
  , decomp = 'QR'
  #, autocor = autocor_str
)


prior1 <- c(
  brms::set_prior("normal(0, 5)", class = "b")
  ,brms::set_prior("normal(0, 20)", class = "Intercept", lb=1, ub=6)
  , brms::set_prior("normal(0, 2)", class = "sd", group = "coupleID", lb = 0)
  , brms::set_prior("student_t(3, 0, 2.5)", class = "sigma", lb = 0)
)

#brms::validate_prior(
#  prior1, 
#  formula = formula, 
#  data = df_double, 
#  family = gaussian()
#  )

#df_minimal <- df_double[, c("AorB", all.vars(as.formula(formula)))]

mood_gauss <- my_brm(
  mi = use_mi, 
  imputed_data = implist,
  
  formula = formula, 
  prior = prior1,
  data = df_double, 
  family = gaussian(),
  #control = list(adapt_delta = 0.95, max_treedepth = 15),
  iter = iterations,
  warmup = warmup,
  chains = 4,
  cores = 4,
  seed = 7777,
  file = file.path("models_cache_brms", paste0("mood_gauss", suffix))
)
## Warning: Rows containing NAs were excluded from the model.
mood_gauss_digest <- digest::digest(mood_gauss)
summary_mood <- summarize_brms(
  mood_gauss, 
  stats_to_report = stats_to_report,
  model_rows_fixed = model_rows_fixed,
  model_rows_random = model_rows_random,
  model_rownames_fixed = model_rownames_fixed,
  model_rownames_random = model_rownames_random,
  exponentiate = F) 
## Warning in compute_rope(range = rope_range): Collinearity detected. Some VIFs
## are > 10. This may invalidate ROPE inferences!

Check for Multicollinearity

Low Correlation

              Term  VIF     VIF 95% CI Increased SE Tolerance
persuasion_self_cw 1.14 [ 1.11,  1.18]         1.07      0.88

persuasion_partner_cw 1.10 [ 1.07, 1.14] 1.05 0.91 pressure_self_cw 1.10 [ 1.07, 1.14] 1.05 0.91 pressure_partner_cw 1.07 [ 1.04, 1.11] 1.03 0.93 pushing_self_cw 1.16 [ 1.13, 1.21] 1.08 0.86 pushing_partner_cw 1.15 [ 1.11, 1.19] 1.07 0.87 isWeekend 1.04 [ 1.02, 1.09] 1.02 0.96 got_JITAI_self 1.09 [ 1.06, 1.13] 1.04 0.92 skilled_support 2.04 [ 1.96, 2.14] 1.43 0.49 studyGroup 1.13 [ 1.09, 1.17] 1.06 0.89 plan_self 1.29 [ 1.25, 1.34] 1.14 0.78 plan_partner 1.28 [ 1.23, 1.33] 1.13 0.78 day 1.99 [ 1.91, 2.08] 1.41 0.50 Tolerance 95% CI [0.85, 0.90] [0.88, 0.94] [0.88, 0.94] [0.90, 0.96] [0.83, 0.89] [0.84, 0.90] [0.92, 0.98] [0.89, 0.94] [0.47, 0.51] [0.86, 0.91] [0.75, 0.80] [0.75, 0.81] [0.48, 0.52]

Moderate Correlation

            Term  VIF     VIF 95% CI Increased SE Tolerance
pressure_self_cb 5.52 [ 5.24,  5.83]         2.35      0.18

pressure_partner_cb 5.56 [ 5.27, 5.87] 2.36 0.18 pushing_self_cb 8.67 [ 8.20, 9.17] 2.94 0.12 pushing_partner_cb 8.62 [ 8.16, 9.12] 2.94 0.12 Tolerance 95% CI [0.17, 0.19] [0.17, 0.19] [0.11, 0.12] [0.11, 0.12]

High Correlation

              Term   VIF     VIF 95% CI Increased SE Tolerance
persuasion_self_cb 13.89 [13.12, 14.71]         3.73      0.07

persuasion_partner_cb 13.87 [13.10, 14.68] 3.72 0.07 Tolerance 95% CI [0.07, 0.08] [0.07, 0.08]

## Sampling priors, please wait...
summary_mood %>%
  print_df(rows_to_pack = rows_to_pack)
Est. SE 95% CI pd ROPE inside ROPE BF BF_Evidence Rhat Bulk_ESS Tail_ESS
Intercept 3.56*** 0.16 [ 3.23, 3.89] 1.000 [-0.11, 0.11] 0.000 >100 Overwhelming Evidence 1.000 5844 11807
Within-Person Effects
Daily individual’s experienced persuasion 0.00 0.02 [-0.04, 0.04] 0.522 [-0.11, 0.11] 1.000 0.004 Very Strong Evidence for Null 1.000 40415 29542
Daily partner’s experienced persuasion 0.02 0.02 [-0.03, 0.06] 0.757 [-0.11, 0.11] 1.000 0.005 Very Strong Evidence for Null 1.000 32705 29362
Daily individual’s experienced pressure -0.02 0.05 [-0.14, 0.08] 0.662 [-0.11, 0.11] 0.941 0.004 Very Strong Evidence for Null 1.000 39270 27760
Daily partner’s experienced pressure -0.01 0.05 [-0.13, 0.10] 0.584 [-0.11, 0.11] 0.945 0.004 Very Strong Evidence for Null 1.000 36823 27253
Daily individual’s experienced pushing 0.00 0.03 [-0.06, 0.07] 0.542 [-0.11, 0.11] 0.999 0.004 Very Strong Evidence for Null 1.000 45099 29788
Daily partner’s experienced pushing 0.07* 0.03 [ 0.00, 0.14] 0.975 [-0.11, 0.11] 0.905 0.031 Strong Evidence for Null 1.000 33993 26876
Day 0.23** 0.08 [ 0.08, 0.38] 0.998 [-0.11, 0.11] 0.072 0.245 Moderate Evidence for Null 1.000 59348 29338
Own Actionplan 0.13** 0.04 [ 0.05, 0.20] 0.999 [-0.11, 0.11] 0.372 0.696 Weak Evidence for Null 1.000 61807 29764
Partner Actionplan -0.03 0.04 [-0.10, 0.05] 0.745 [-0.11, 0.11] 0.988 0.004 Very Strong Evidence for Null 1.000 58313 29688
Daily weartime NA NA NA NA NA NA NA NA NA NA NA
Daily support received NA NA NA NA NA NA NA NA NA NA NA
Daily support provided (partner’s view) NA NA NA NA NA NA NA NA NA NA NA
Is a Weekend 0.15*** 0.04 [ 0.08, 0.21] 1.000 [-0.11, 0.11] 0.193 4.165 Moderate Evidence 1.000 60906 27963
JITAI received -0.10* 0.05 [-0.20, -0.01] 0.984 [-0.11, 0.11] 0.609 0.032 Strong Evidence for Null 1.000 81290 29772
Days post skilled support intervention 0.05 0.06 [-0.06, 0.17] 0.822 [-0.11, 0.11] 0.852 0.005 Very Strong Evidence for Null 1.000 47823 35802
Between-Person Effects
Mean individual’s experienced persuasion 0.39 0.27 [-0.15, 0.94] 0.925 [-0.11, 0.11] 0.122 0.037 Strong Evidence for Null 1.000 6491 11090
Mean partner’s experienced persuasion 0.26 0.27 [-0.28, 0.81] 0.833 [-0.11, 0.11] 0.208 0.020 Very Strong Evidence for Null 1.000 6363 11215
Mean individual’s experienced pressure -0.28 0.27 [-0.81, 0.24] 0.854 [-0.11, 0.11] 0.199 0.014 Very Strong Evidence for Null 1.000 7562 13793
Mean partner’s experienced pressure -0.29 0.26 [-0.82, 0.24] 0.863 [-0.11, 0.11] 0.189 0.015 Very Strong Evidence for Null 1.000 7293 14064
Mean individual’s experienced pushing 0.11 0.38 [-0.66, 0.87] 0.617 [-0.11, 0.11] 0.226 0.011 Very Strong Evidence for Null 1.001 8186 13586
Mean partner’s experienced pushing 0.27 0.38 [-0.50, 1.02] 0.764 [-0.11, 0.11] 0.185 0.013 Very Strong Evidence for Null 1.001 8168 13780
Mean weartime NA NA NA NA NA NA NA NA NA NA NA
Mean individual’s received support NA NA NA NA NA NA NA NA NA NA NA
Mean partner’s received support NA NA NA NA NA NA NA NA NA NA NA
Difference study group 2 -0.21 0.22 [-0.66, 0.24] 0.830 [-0.11, 0.11] 0.258 0.028 Very Strong Evidence for Null 1.001 6328 10564
Difference study group 3 0.35 0.22 [-0.10, 0.80] 0.937 [-0.11, 0.11] 0.126 0.054 Strong Evidence for Null 1.000 4708 9432
Random Effects
sd(Intercept) 0.56 0.07 [0.44, 0.74] NA NA NA NA NA 1.000 9471 16569
sd(Daily individual’s experienced persuasion) 0.04 0.03 [0.00, 0.10] NA NA NA NA NA 1.000 11769 14579
sd(Daily partner’s experienced persuasion) 0.07 0.03 [0.01, 0.13] NA NA NA NA NA 1.000 9695 8040
sd(Daily individual’s experienced pressure) 0.07 0.06 [0.00, 0.25] NA NA NA NA NA 1.000 16105 17953
sd(Daily partner’s experienced pressure) 0.08 0.07 [0.00, 0.27] NA NA NA NA NA 1.000 14513 16913
sd(Daily individual’s experienced pushing) 0.05 0.04 [0.00, 0.14] NA NA NA NA NA 1.000 15105 17267
sd(Daily partner’s experienced pushing) 0.06 0.05 [0.00, 0.16] NA NA NA NA NA 1.000 13248 15418
Additional Parameters
sigma 0.96 0.01 [0.94, 0.98] NA NA NA NA NA 1.000 59952 29269
plot(
  bayestestR::p_direction(mood_gauss),
  priors = TRUE
)  + 
  coord_cartesian(xlim = c(-3, 3)) +
  theme_bw()
## Warning in `==.default`(dens$Parameter, parameter): longer object length is not
## a multiple of shorter object length
## Warning in is.na(e1) | is.na(e2): longer object length is not a multiple of
## shorter object length

plot(
  bayestestR::rope(mood_gauss, ci = 1)
) + theme_bw()
## Possible multicollinearity between b_pressure_self_cb and
##   b_persuasion_self_cb (r = 0.8), b_pressure_partner_cb and
##   b_persuasion_self_cb (r = 0.77), b_pressure_self_cb and
##   b_persuasion_partner_cb (r = 0.77), b_pressure_partner_cb and
##   b_persuasion_partner_cb (r = 0.8), b_pressure_partner_cb and
##   b_pressure_self_cb (r = 0.75), b_pushing_partner_cb and
##   b_pushing_self_cb (r = 0.89). This might lead to inappropriate results.
##   See 'Details' in '?rope'.

conditional_spaghetti(
  mood_gauss, 
  effects = c('pushing_partner_cw'),
  group_var = 'coupleID',
  plot_full_range = TRUE
)

$pushing_partner_cw

Reactance

Ordinal

df_double$reactance_ordinal <- factor(df_double$reactance,
                                      levels = 0:5, 
                                      ordered = TRUE)

formula <- bf(
  reactance_ordinal ~ 
    persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    
    #support_self_cw + support_partner_cw + 
    isWeekend + 
    got_JITAI_self + 
    skilled_support +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    #support_self_cb + support_partner_cb + 
    studyGroup +
    
    plan_self + plan_partner +
    day + 
    
    # Random effects
    (persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | coupleID)
  
  , decomp = 'QR'
  #, autocor = autocor_str
)


prior1 <- c(
  brms::set_prior("normal(0, 2.5)", class = "b")
  , brms::set_prior("normal(0, 2)", class = "sd", group = "coupleID", lb = 0)
)


#brms::validate_prior(
#  prior1, 
#  formula = formula, 
#  data = df_double, 
#  family = cumulative() # HURDLE_CUMULATIVE
#  )


#df_minimal <- df_double[, c("AorB", all.vars(as.formula(formula)))]

reactance_ordinal <- my_brm(
  mi = use_mi, 
  imputed_data = implist,
  
  formula = formula, 
  prior = prior1,
  data = df_double, 
  family = brms::cumulative(),
  #control = list(adapt_delta = 0.95),
  iter = iterations,
  warmup = warmup,
  chains = 4,
  cores = 4,
  seed = 7777
  , file = file.path("models_cache_brms", paste0("reactance_ordinal", suffix))
)
## Warning: Rows containing NAs were excluded from the model.
reactance_ordinal_digest <- digest::digest(reactance_ordinal)
summary_reactance_ordinal <- summarize_brms(
  reactance_ordinal, 
  stats_to_report = stats_to_report,
  rope_range = c(-0.18, 0.18),
  model_rows_fixed = model_rows_fixed_ordinal,
  model_rows_random = model_rows_random_ordinal,
  model_rownames_fixed = model_rownames_fixed_ordinal,
  model_rownames_random = model_rownames_random_ordinal,
  exponentiate = T) 
## Warning in compute_rope(range = rope_range): Collinearity detected. Some VIFs
## are > 10. This may invalidate ROPE inferences!

Check for Multicollinearity

Low Correlation

              Term  VIF     VIF 95% CI Increased SE Tolerance

pressure_partner_cw 1.72 [ 1.63, 1.83] 1.31 0.58 pushing_self_cw 1.33 [ 1.27, 1.41] 1.15 0.75 pushing_partner_cw 1.11 [ 1.07, 1.18] 1.06 0.90 isWeekend 1.10 [ 1.06, 1.16] 1.05 0.91 got_JITAI_self 1.08 [ 1.04, 1.14] 1.04 0.93 skilled_support 1.39 [ 1.33, 1.48] 1.18 0.72 persuasion_self_cb 1.20 [ 1.15, 1.26] 1.09 0.83 persuasion_partner_cb 1.15 [ 1.11, 1.22] 1.07 0.87 pressure_self_cb 1.26 [ 1.20, 1.33] 1.12 0.79 pressure_partner_cb 4.11 [ 3.83, 4.42] 2.03 0.24 plan_self 2.34 [ 2.20, 2.50] 1.53 0.43 plan_partner 2.66 [ 2.49, 2.85] 1.63 0.38 day 2.23 [ 2.09, 2.38] 1.49 0.45 Tolerance 95% CI [0.55, 0.61] [0.71, 0.79] [0.85, 0.93] [0.86, 0.95] [0.88, 0.96] [0.68, 0.75] [0.79, 0.87] [0.82, 0.90] [0.75, 0.83] [0.23, 0.26] [0.40, 0.46] [0.35, 0.40] [0.42, 0.48]

Moderate Correlation

           Term  VIF     VIF 95% CI Increased SE Tolerance Tolerance 95% CI

pressure_self_cw 6.37 [ 5.92, 6.87] 2.52 0.16 [0.15, 0.17] pushing_self_cb 6.52 [ 6.05, 7.04] 2.55 0.15 [0.14, 0.17] pushing_partner_cb 8.27 [ 7.66, 8.93] 2.88 0.12 [0.11, 0.13]

High Correlation

              Term   VIF     VIF 95% CI Increased SE Tolerance
persuasion_self_cw 14.96 [13.83, 16.19]         3.87      0.07

persuasion_partner_cw 15.75 [14.56, 17.05] 3.97 0.06 studyGroup 22.18 [20.49, 24.03] 4.71 0.05 Tolerance 95% CI [0.06, 0.07] [0.06, 0.07] [0.04, 0.05]

## Sampling priors, please wait...
summary_reactance_ordinal %>%
  print_df(rows_to_pack = rows_to_pack_ordinal)
OR SE 95% CI pd ROPE inside ROPE BF BF_Evidence Rhat Bulk_ESS Tail_ESS
Intercepts
Intercept NA NA NA NA NA NA NA NA NA NA NA
Intercept[1] 2.00 0.79 [ 0.93, 4.49] 0.963 [0.84, 1.20] 0.080 0.188 Moderate Evidence for Null 1.000 30668 29360
Intercept[2] 4.41*** 1.79 [ 2.05, 10.05] 1.000 [0.84, 1.20] 0.000 32.134 Very Strong Evidence 1.000 30524 27684
Intercept[3] 11.92*** 4.98 [ 5.40, 28.22] 1.000 [0.84, 1.20] 0.000 >100 Overwhelming Evidence 1.000 30791 29212
Intercept[4] 50.98*** 23.49 [ 21.54, 131.03] 1.000 [0.84, 1.20] 0.000 >100 Overwhelming Evidence 1.000 30657 29001
Intercept[5] 1584.75*** 1122.79 [435.24, 6903.06] 1.000 [0.84, 1.20] 0.000 >100 Overwhelming Evidence 1.000 36368 30707
Within-Person Effects
Daily individual’s experienced persuasion 0.86 0.07 [ 0.72, 1.01] 0.966 [0.84, 1.20] 0.613 0.264 Moderate Evidence for Null 1.000 30083 26859
Daily partner’s experienced persuasion 1.01 0.10 [ 0.82, 1.24] 0.554 [0.84, 1.20] 0.916 0.047 Strong Evidence for Null 1.000 29423 25629
Daily individual’s experienced pressure 1.83* 0.35 [ 1.15, 2.62] 0.993 [0.84, 1.20] 0.032 1.892 Weak Evidence 1.000 17725 19483
Daily partner’s experienced pressure 1.23 0.30 [ 0.68, 2.10] 0.797 [0.84, 1.20] 0.382 0.080 Strong Evidence for Null 1.000 18931 16192
Daily individual’s experienced pushing 1.24 0.14 [ 0.99, 1.56] 0.967 [0.84, 1.20] 0.390 0.274 Moderate Evidence for Null 1.000 26253 25762
Daily partner’s experienced pushing 0.96 0.13 [ 0.72, 1.25] 0.625 [0.84, 1.20] 0.795 0.047 Strong Evidence for Null 1.000 26476 23939
Day 1.72 0.82 [ 0.66, 4.37] 0.870 [0.84, 1.20] 0.158 0.071 Strong Evidence for Null 1.000 38344 29944
Own Actionplan 0.79 0.24 [ 0.44, 1.41] 0.782 [0.84, 1.20] 0.351 0.053 Strong Evidence for Null 1.000 39810 29550
Partner Actionplan 0.86 0.23 [ 0.52, 1.45] 0.712 [0.84, 1.20] 0.445 0.045 Strong Evidence for Null 1.000 36678 30639
Daily weartime NA NA NA NA NA NA NA NA NA NA NA
Daily support received NA NA NA NA NA NA NA NA NA NA NA
Daily support provided (partner’s view) NA NA NA NA NA NA NA NA NA NA NA
Is a Weekend 0.62* 0.13 [ 0.40, 0.94] 0.988 [0.84, 1.20] 0.073 0.453 Weak Evidence for Null 1.000 47237 32149
JITAI received 1.27 0.35 [ 0.74, 2.18] 0.813 [0.84, 1.20] 0.350 0.053 Strong Evidence for Null 1.000 46810 31201
Days post skilled support intervention 0.82 0.29 [ 0.41, 1.65] 0.712 [0.84, 1.20] 0.336 0.045 Strong Evidence for Null 1.000 47691 29126
Between-Person Effects
Mean individual’s experienced persuasion 0.87 0.43 [ 0.32, 2.38] 0.613 [0.84, 1.20] 0.273 0.054 Strong Evidence for Null 1.000 21453 25466
Mean partner’s experienced persuasion 1.33 0.77 [ 0.44, 4.30] 0.695 [0.84, 1.20] 0.219 0.058 Strong Evidence for Null 1.000 21944 24421
Mean individual’s experienced pressure 3.91* 2.12 [ 1.38, 12.13] 0.994 [0.84, 1.20] 0.011 1.250 Weak Evidence 1.000 19938 25916
Mean partner’s experienced pressure 1.29 0.74 [ 0.40, 3.90] 0.675 [0.84, 1.20] 0.223 0.054 Strong Evidence for Null 1.000 18928 24521
Mean individual’s experienced pushing 1.54 1.14 [ 0.36, 6.99] 0.723 [0.84, 1.20] 0.165 0.060 Strong Evidence for Null 1.000 17717 22675
Mean partner’s experienced pushing 0.08** 0.08 [ 0.01, 0.52] 0.996 [0.84, 1.20] 0.005 2.094 Weak Evidence 1.000 21162 25207
Mean weartime NA NA NA NA NA NA NA NA NA NA NA
Mean individual’s received support NA NA NA NA NA NA NA NA NA NA NA
Mean partner’s received support NA NA NA NA NA NA NA NA NA NA NA
Difference study group 2 1.08 0.41 [ 0.49, 2.32] 0.578 [0.84, 1.20] 0.356 0.056 Strong Evidence for Null 1.000 20601 26250
Difference study group 3 0.36* 0.15 [ 0.15, 0.87] 0.987 [0.84, 1.20] 0.025 0.854 Weak Evidence for Null 1.000 18739 24668
Random Effects
sd(Intercept) 0.64 0.22 [0.21, 1.14] NA NA NA NA NA 1.000 8500 8003
sd(Daily individual’s experienced persuasion) 0.18 0.13 [0.01, 0.45] NA NA NA NA NA 1.000 6069 10323
sd(Daily partner’s experienced persuasion) 0.22 0.14 [0.01, 0.53] NA NA NA NA NA 1.000 9304 11594
sd(Daily individual’s experienced pressure) 0.53 0.27 [0.05, 1.14] NA NA NA NA NA 1.001 7911 9419
sd(Daily partner’s experienced pressure) 0.41 0.38 [0.02, 1.55] NA NA NA NA NA 1.001 9709 15866
sd(Daily individual’s experienced pushing) 0.24 0.14 [0.02, 0.56] NA NA NA NA NA 1.000 8773 11200
sd(Daily partner’s experienced pushing) 0.15 0.14 [0.01, 0.61] NA NA NA NA NA 1.000 13960 16216
Additional Parameters
sigma NA NA NA NA NA NA NA NA NA NA NA
disc 1.00 0.00 [1.00, 1.00] NA NA NA NA NA NA NA NA
plot(
  bayestestR::p_direction(reactance_ordinal),
  priors = TRUE
) + 
  coord_cartesian(xlim = c(-6, 6)) +
  theme_bw()

plot(
  bayestestR::rope(reactance_ordinal, range = c(-0.18, 0.18), ci = 1)
) + theme_bw()
## Possible multicollinearity between b_Intercept[4] and b_Intercept[2] (r
##   = 0.87), b_pressure_partner_cb and b_persuasion_partner_cb (r = 0.78).
##   This might lead to inappropriate results. See 'Details' in '?rope'.

Binary

introduce_binary_reactance <- function(data) {
  data$is_reactance <- factor(data$reactance > 0, levels = c(FALSE, TRUE), labels = c(0, 1))
  return(data)
}



df_double <- introduce_binary_reactance(df_double)
if (use_mi) {
  for (i in seq_along(implist)) {
    implist[[i]] <- introduce_binary_reactance(implist[[i]])
  }
}


formula <- bf(
  is_reactance ~ 
    persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    
    #support_self_cw + support_partner_cw + 
    isWeekend + 
    got_JITAI_self + 
    skilled_support +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    #support_self_cb + support_partner_cb + 
    studyGroup +
    
    plan_self + plan_partner +
    day + 
    
    # Random effects
    (persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | coupleID)
  
  , decomp = 'QR'
  #, autocor = autocor_str
  )



prior1 <- c(
  brms::set_prior("normal(0, 2.5)", class = "b")
  , brms::set_prior("normal(0, 10)", class = "Intercept", lb=0, ub=5) 
  , brms::set_prior("normal(0, 2)", class = "sd", group = "coupleID", lb = 0)
)


#brms::validate_prior(
#  prior1, 
#  formula = formula, 
#  data = df_double, 
#  family = bernoulli()
#  )



#df_minimal <- df_double[, c("AorB", all.vars(as.formula(formula)))]

is_reactance <- my_brm(
  mi = use_mi, 
  imputed_data = implist,
  
  formula = formula, 
  prior = prior1,
  data = df_double, 
  family = brms::bernoulli(),
  #control = list(adapt_delta = 0.95, max_treedepth = 15),
  iter = iterations,
  warmup = warmup,
  chains = 4,
  cores = 4,
  seed = 7777,
  file = file.path("models_cache_brms", paste0("is_reactance", suffix))
  #, file_refit = 'always'
)
## Warning: Rows containing NAs were excluded from the model.
is_reactance_digest <- digest::digest(is_reactance)
summary_is_reactance <- summarize_brms(
  is_reactance,
  stats_to_report = stats_to_report,
  model_rows_fixed = model_rows_fixed,
  model_rows_random = model_rows_random,
  model_rownames_fixed = model_rownames_fixed,
  model_rownames_random = model_rownames_random,
  exponentiate = T) 
## Sampling priors, please wait...
summary_is_reactance %>%
  print_df(rows_to_pack = rows_to_pack)
OR SE 95% CI pd ROPE inside ROPE BF BF_Evidence Rhat Bulk_ESS Tail_ESS
Intercept 0.62 0.30 [0.23, 1.62] 0.837 [0.83, 1.20] 0.184 0.085 Strong Evidence for Null 1.000 25105 29851
Within-Person Effects
Daily individual’s experienced persuasion 0.84 0.09 [0.68, 1.03] 0.958 [0.83, 1.20] 0.541 0.240 Moderate Evidence for Null 1.000 31253 28630
Daily partner’s experienced persuasion 1.14 0.18 [0.84, 1.60] 0.800 [0.83, 1.20] 0.612 0.095 Strong Evidence for Null 1.000 19207 24180
Daily individual’s experienced pressure 1.99* 0.66 [1.03, 4.87] 0.979 [0.83, 1.20] 0.051 0.961 Weak Evidence for Null 1.001 16301 17024
Daily partner’s experienced pressure 1.45 0.65 [0.56, 4.71] 0.802 [0.83, 1.20] 0.223 0.137 Moderate Evidence for Null 1.000 17230 18755
Daily individual’s experienced pushing 1.37* 0.19 [1.06, 1.83] 0.991 [0.83, 1.20] 0.153 0.991 Weak Evidence for Null 1.000 29562 27215
Daily partner’s experienced pushing 0.91 0.18 [0.60, 1.36] 0.687 [0.83, 1.20] 0.577 0.080 Strong Evidence for Null 1.000 26807 25067
Day 2.11 1.20 [0.69, 6.36] 0.906 [0.83, 1.20] 0.108 0.106 Moderate Evidence for Null 1.000 38208 29162
Own Actionplan 0.81 0.27 [0.42, 1.57] 0.737 [0.83, 1.20] 0.338 0.054 Strong Evidence for Null 1.000 40855 28916
Partner Actionplan 0.84 0.25 [0.46, 1.52] 0.719 [0.83, 1.20] 0.386 0.052 Strong Evidence for Null 1.000 40714 27635
Daily weartime NA NA NA NA NA NA NA NA NA NA NA
Daily support received NA NA NA NA NA NA NA NA NA NA NA
Daily support provided (partner’s view) NA NA NA NA NA NA NA NA NA NA NA
Is a Weekend 0.61 0.16 [0.36, 1.02] 0.970 [0.83, 1.20] 0.116 0.264 Moderate Evidence for Null 1.000 48766 31499
JITAI received 1.47 0.48 [0.77, 2.78] 0.877 [0.83, 1.20] 0.225 0.087 Strong Evidence for Null 1.000 40721 30512
Days post skilled support intervention 0.72 0.29 [0.33, 1.56] 0.795 [0.83, 1.20] 0.254 0.062 Strong Evidence for Null 1.000 42039 33004
Between-Person Effects
Mean individual’s experienced persuasion 1.59 1.09 [0.42, 6.85] 0.751 [0.83, 1.20] 0.170 0.089 Strong Evidence for Null 1.000 18671 26193
Mean partner’s experienced persuasion 1.97 1.49 [0.46, 9.66] 0.820 [0.83, 1.20] 0.132 0.103 Moderate Evidence for Null 1.000 18982 26195
Mean individual’s experienced pressure 36.37** 48.21 [3.22, 617.66] 0.999 [0.83, 1.20] 0.002 9.336 Moderate Evidence 1.000 12515 18763
Mean partner’s experienced pressure 2.00 2.78 [0.10, 24.54] 0.689 [0.83, 1.20] 0.089 0.135 Moderate Evidence for Null 1.000 11967 21167
Mean individual’s experienced pushing 0.73 0.86 [0.07, 7.13] 0.604 [0.83, 1.20] 0.119 0.084 Strong Evidence for Null 1.000 16764 23152
Mean partner’s experienced pushing 0.05* 0.07 [0.00, 0.64] 0.989 [0.83, 1.20] 0.008 1.161 Weak Evidence 1.000 16820 23993
Mean weartime NA NA NA NA NA NA NA NA NA NA NA
Mean individual’s received support NA NA NA NA NA NA NA NA NA NA NA
Mean partner’s received support NA NA NA NA NA NA NA NA NA NA NA
Difference study group 2 1.10 0.60 [0.36, 3.27] 0.570 [0.83, 1.20] 0.257 0.080 Strong Evidence for Null 1.000 15870 22252
Difference study group 3 0.36 0.21 [0.11, 1.21] 0.955 [0.83, 1.20] 0.053 0.360 Weak Evidence for Null 1.000 16863 22561
Random Effects
sd(Intercept) 1.17 0.28 [0.69, 1.83] NA NA NA NA NA 1.001 11762 18857
sd(Daily individual’s experienced persuasion) 0.25 0.15 [0.02, 0.57] NA NA NA NA NA 1.001 6791 11619
sd(Daily partner’s experienced persuasion) 0.52 0.21 [0.14, 1.03] NA NA NA NA NA 1.000 10860 10273
sd(Daily individual’s experienced pressure) 1.10 0.59 [0.11, 2.49] NA NA NA NA NA 1.001 6782 6614
sd(Daily partner’s experienced pressure) 0.87 0.71 [0.04, 2.83] NA NA NA NA NA 1.000 11338 14360
sd(Daily individual’s experienced pushing) 0.26 0.17 [0.02, 0.65] NA NA NA NA NA 1.000 10950 13641
sd(Daily partner’s experienced pushing) 0.25 0.22 [0.01, 0.94] NA NA NA NA NA 1.000 14970 18666
Additional Parameters
sigma NA NA NA NA NA NA NA NA NA NA NA
plot(
  bayestestR::p_direction(is_reactance),
  priors = TRUE
) + 
  coord_cartesian(xlim = c(-6, 6)) +
  theme_bw()
## Warning in `==.default`(dens$Parameter, parameter): longer object length is not
## a multiple of shorter object length
## Warning in is.na(e1) | is.na(e2): longer object length is not a multiple of
## shorter object length

plot(
  bayestestR::rope(is_reactance, ci = 1)
) + theme_bw()

conditional_spaghetti(
  is_reactance, 
  effects = c('pressure_self_cw', 'pushing_self_cw'),
  group_var = 'coupleID',
  plot_full_range = TRUE
)

\(pressure_self_cw <img src="04_SensitivityOtherCovariates_files/figure-html/report_is_reactance-3.png" width="2400" />\)pushing_self_cw

Report All Models

summary_all_models <- report_side_by_side(
  pa_sub,
  pa_obj_log,
  mood_gauss,
  is_reactance,
  
  stats_to_report = c('CI'),
  model_rows_random = model_rows_random,
  model_rows_fixed = model_rows_fixed,
  model_rownames_random = model_rownames_random,
  model_rownames_fixed = model_rownames_fixed
)

[1] “pa_sub”

## Warning in summarize_brms(model, exponentiate = exponentiate, stats_to_report =
## stats_to_report, : Coefficients were exponentiated. Double check if this was
## intended.

[1] “pa_obj_log”

## Warning in summarize_brms(model, exponentiate = exponentiate, stats_to_report =
## stats_to_report, : Coefficients were exponentiated. Double check if this was
## intended.

[1] “mood_gauss” [1] “is_reactance”

summary_all_models <- summary_all_models %>%
  print_df(rows_to_pack = rows_to_pack) %>%
  add_header_above(
    c(
      " ", "Hurdle Component" = 2, "Non-Zero Component" = 2,
      " " = 6
    )
  ) %>%
  add_header_above(
    c(" ", "Subjective MVPA Hurdle Lognormal" = 4,  
      "Device-Based MVPA Log (Gaussian)" = 2, 
      "Mood Gaussian" = 2,
      #"Reactance Ordinal" = 2,
      "Reactance Dichotome" = 2
    )
  )

export_xlsx(
  summary_all_models, 
  rows_to_pack = rows_to_pack,
  file.path("Output", paste0("AllModels", suffix, ".xlsx")), 
  merge_option = 'both', 
  simplify_2nd_row = TRUE,
  line_above_rows = c(1,2),
  line_below_rows = c(-1)
)
## 
## Attaching package: 'rvest'
## The following object is masked from 'package:readr':
## 
##     guess_encoding
summary_all_models
Subjective MVPA Hurdle Lognormal
Device-Based MVPA Log (Gaussian)
Mood Gaussian
Reactance Dichotome
Hurdle Component
Non-Zero Component
exp(Est.)_hu pa_sub 95% CI_hu pa_sub exp(Est.)_nonzero pa_sub 95% CI_nonzero pa_sub exp(Est.) pa_obj_log 95% CI pa_obj_log Est. mood_gauss 95% CI mood_gauss OR is_reactance 95% CI is_reactance
Intercept 0.18*** [ 0.10, 0.30] 29.02*** [23.19, 36.50] 108.21*** [90.06, 129.44] 3.56*** [ 3.23, 3.89] 0.62 [0.23, 1.62]
Within-Person Effects
Daily individual’s experienced persuasion 1.57*** [ 1.38, 1.83] 1.03 [ 0.98, 1.08] 1.03 [ 1.00, 1.06] 0.00 [-0.04, 0.04] 0.84 [0.68, 1.03]
Daily partner’s experienced persuasion 1.33*** [ 1.18, 1.53] 1.03 [ 0.98, 1.07] 1.01 [ 0.98, 1.05] 0.02 [-0.03, 0.06] 1.14 [0.84, 1.60]
Daily individual’s experienced pressure 0.98 [ 0.70, 1.37] 0.90* [ 0.81, 1.00] 0.95 [ 0.88, 1.01] -0.02 [-0.14, 0.08] 1.99* [1.03, 4.87]
Daily partner’s experienced pressure 1.56* [ 1.04, 2.74] 0.95 [ 0.86, 1.04] 0.98 [ 0.92, 1.05] -0.01 [-0.13, 0.10] 1.45 [0.56, 4.71]
Daily individual’s experienced pushing 1.00 [ 0.76, 1.35] 0.99 [ 0.92, 1.05] 1.02 [ 0.96, 1.07] 0.00 [-0.06, 0.07] 1.37* [1.06, 1.83]
Daily partner’s experienced pushing 1.33* [ 1.05, 1.72] 0.96 [ 0.90, 1.02] 1.00 [ 0.96, 1.04] 0.07* [ 0.00, 0.14] 0.91 [0.60, 1.36]
Day 0.69 [ 0.46, 1.04] 0.94 [ 0.79, 1.11] 0.94 [ 0.86, 1.03] 0.23** [ 0.08, 0.38] 2.11 [0.69, 6.36]
Own Actionplan 11.49*** [ 9.35, 14.19] 1.37*** [ 1.24, 1.50] 1.08** [ 1.02, 1.13] 0.13** [ 0.05, 0.20] 0.81 [0.42, 1.57]
Partner Actionplan 1.24* [ 1.01, 1.51] 1.08 [ 0.99, 1.18] 1.05* [ 1.00, 1.11] -0.03 [-0.10, 0.05] 0.84 [0.46, 1.52]
Daily weartime NA NA NA NA 1.00*** [ 1.00, 1.00] NA NA NA NA
Daily support received NA NA NA NA NA NA NA NA NA NA
Daily support provided (partner’s view) NA NA NA NA NA NA NA NA NA NA
Is a Weekend 1.57*** [ 1.29, 1.91] 1.19*** [ 1.10, 1.28] 1.06** [ 1.01, 1.11] 0.15*** [ 0.08, 0.21] 0.61 [0.36, 1.02]
JITAI received 0.49*** [ 0.38, 0.63] 0.94 [ 0.85, 1.04] 0.93* [ 0.87, 0.99] -0.10* [-0.20, -0.01] 1.47 [0.77, 2.78]
Days post skilled support intervention 1.31 [ 0.96, 1.80] 1.07 [ 0.94, 1.21] 1.05 [ 0.98, 1.13] 0.05 [-0.06, 0.17] 0.72 [0.33, 1.56]
Between-Person Effects
Mean individual’s experienced persuasion 1.44 [ 0.65, 3.13] 0.99 [ 0.72, 1.34] 1.10 [ 0.82, 1.49] 0.39 [-0.15, 0.94] 1.59 [0.42, 6.85]
Mean partner’s experienced persuasion 1.32 [ 0.60, 2.88] 0.93 [ 0.68, 1.26] 0.98 [ 0.73, 1.33] 0.26 [-0.28, 0.81] 1.97 [0.46, 9.66]
Mean individual’s experienced pressure 0.16*** [ 0.05, 0.47] 0.69 [ 0.33, 1.45] 0.98 [ 0.72, 1.32] -0.28 [-0.81, 0.24] 36.37** [3.22, 617.66]
Mean partner’s experienced pressure 0.27* [ 0.08, 0.78] 0.53 [ 0.25, 1.12] 0.98 [ 0.73, 1.32] -0.29 [-0.82, 0.24] 2.00 [0.10, 24.54]
Mean individual’s experienced pushing 1.39 [ 0.42, 4.73] 1.47 [ 0.86, 2.52] 0.96 [ 0.63, 1.47] 0.11 [-0.66, 0.87] 0.73 [0.07, 7.13]
Mean partner’s experienced pushing 2.33 [ 0.70, 7.85] 1.63 [ 0.94, 2.83] 1.20 [ 0.79, 1.84] 0.27 [-0.50, 1.02] 0.05* [0.00, 0.64]
Mean weartime NA NA NA NA 1.00 [ 1.00, 1.00] NA NA NA NA
Mean individual’s received support NA NA NA NA NA NA NA NA NA NA
Mean partner’s received support NA NA NA NA NA NA NA NA NA NA
Difference study group 2 0.79 [ 0.39, 1.60] 1.06 [ 0.81, 1.38] 0.94 [ 0.73, 1.20] -0.21 [-0.66, 0.24] 1.10 [0.36, 3.27]
Difference study group 3 1.17 [ 0.59, 2.33] 1.25 [ 0.97, 1.60] 1.03 [ 0.80, 1.33] 0.35 [-0.10, 0.80] 0.36 [0.11, 1.21]
Random Effects
sd(Intercept) 0.83 [0.63, 1.12] 0.29 [0.22, 0.40] 0.30 [0.24, 0.40] 0.56 [0.44, 0.74] 1.17 [0.69, 1.83]
sd(Daily individual’s experienced persuasion) 0.20 [0.03, 0.40] 0.12 [0.08, 0.17] 0.05 [0.02, 0.08] 0.04 [0.00, 0.10] 0.25 [0.02, 0.57]
sd(Daily partner’s experienced persuasion) 0.16 [0.01, 0.36] 0.08 [0.04, 0.13] 0.05 [0.02, 0.09] 0.07 [0.01, 0.13] 0.52 [0.14, 1.03]
sd(Daily individual’s experienced pressure) 0.21 [0.01, 0.78] 0.07 [0.00, 0.23] 0.04 [0.00, 0.13] 0.07 [0.00, 0.25] 1.10 [0.11, 2.49]
sd(Daily partner’s experienced pressure) 0.39 [0.02, 1.25] 0.05 [0.00, 0.18] 0.03 [0.00, 0.11] 0.08 [0.00, 0.27] 0.87 [0.04, 2.83]
sd(Daily individual’s experienced pushing) 0.51 [0.21, 0.91] 0.08 [0.01, 0.16] 0.08 [0.01, 0.16] 0.05 [0.00, 0.14] 0.26 [0.02, 0.65]
sd(Daily partner’s experienced pushing) 0.23 [0.01, 0.59] 0.07 [0.01, 0.14] 0.03 [0.00, 0.09] 0.06 [0.00, 0.16] 0.25 [0.01, 0.94]
Additional Parameters
sigma NA NA 0.67 [0.65, 0.70] 0.57 [0.56, 0.59] 0.96 [0.94, 0.98] NA NA
report::report_system()

Analyses were conducted using the R Statistical language (version 4.4.2; R Core Team, 2024) on Windows 11 x64 (build 26100)

report::report_packages()
  • beepr (version 2.0; Bååth R, 2024)
  • R.methodsS3 (version 1.8.2; Bengtsson H, 2003)
  • R.oo (version 1.27.0; Bengtsson H, 2003)
  • R.utils (version 2.12.3; Bengtsson H, 2023)
  • brms (version 2.22.0; Bürkner P, 2017)
  • digest (version 0.6.37; Eddelbuettel D, 2024)
  • Rcpp (version 1.0.13.1; Eddelbuettel D et al., 2024)
  • bayesplot (version 1.11.1; Gabry J, Mahr T, 2024)
  • lubridate (version 1.9.3; Grolemund G, Wickham H, 2011)
  • DHARMa (version 0.4.7; Hartig F, 2024)
  • wbCorr (version 0.1.22; Küng P, 2023)
  • see (version 0.9.0; Lüdecke D et al., 2021)
  • tibble (version 3.2.1; Müller K, Wickham H, 2023)
  • R (version 4.4.2; R Core Team, 2024)
  • openxlsx (version 4.2.7.1; Schauberger P, Walker A, 2024)
  • ggplot2 (version 3.5.1; Wickham H, 2016)
  • forcats (version 1.0.0; Wickham H, 2023)
  • stringr (version 1.5.1; Wickham H, 2023)
  • rvest (version 1.0.4; Wickham H, 2024)
  • tidyverse (version 2.0.0; Wickham H et al., 2019)
  • readxl (version 1.4.3; Wickham H, Bryan J, 2023)
  • dplyr (version 1.1.4; Wickham H et al., 2023)
  • purrr (version 1.0.2; Wickham H, Henry L, 2023)
  • readr (version 2.1.5; Wickham H et al., 2024)
  • xml2 (version 1.3.6; Wickham H et al., 2023)
  • tidyr (version 1.3.1; Wickham H et al., 2024)
  • knitr (version 1.49; Xie Y, 2024)
  • kableExtra (version 1.4.0; Zhu H, 2024)
report::cite_packages()